#include "networkhandler.h"
#include <QDebug>
networkhandler::networkhandler(QObject *parent) : QObject(parent)
{

}

void networkhandler::createSocket()
{
    m_tcp = new QTcpSocket(this);

    connect(m_tcp, &QTcpSocket::connected, this, &networkhandler::handlerConnected);
    m_tcp->connectToHost("www.baidu.com", 80);

}

void networkhandler::handlerConnected()
{
    qDebug() << "连接上了" ;
}
